<div class="layuimini-main" id="DeviceReport-search">
    <form class="layui-form layui-form-pane" lay-filter="DeviceReport_Detail_div_filter">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">设备SN</label>
                <div class="layui-input-inline">
                    <input type="text" name="deviceId" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">人员编号</label>
                <div class="layui-input-inline">
                    <input type="text" name="employeeId" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">体温</label>
                <div class="layui-input-inline">
                    <input type="text" name="humTemp" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="noteTime" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">事件</label>
                <div class="layui-input-inline">
                    <input type="text" name="eventType" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">是否通过</label>
                <div class="layui-input-inline">
                    <input type="text" name="notePass" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">打卡介质</label>
                <div class="layui-input-inline">
                    <input type="text" name="noteWay" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>


        <div class="layui-form-item">

            <div class="defDivImageBox layui-panel">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                    <legend>现场照片</legend>
                    <div class="layui-form-item " id="ReportImage">
                        <img id="showReportImg" src="/NoPIC.jpg">
                    </div>
                </fieldset>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <button type="submit" class="layui-btn layui-btn-primary" id="btnsearchclose"><i class="layui-icon">&#x1006;</i> 关闭</button>
            </div>
        </div>
    </form>

</div>
<script>

    layui.use(['form', 'faceAPI'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        var faceAPI = layui.faceAPI;
        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        if (faceAPI.DeviceReportDetail != null) {
            var report = faceAPI.DeviceReportDetail;
            form.val("DeviceReport_Detail_div_filter", report);
            if (report.pic_len > 0 && report.imgURL.length > 0) {
                $('#ReportImage').find('img').remove();
                $('#ReportImage').append('<img id="showReportImg" src="' + report.imgURL + '" width="240">');
                bindshowPeopleImgClick();
            }

        }

        $('#btnsearchclose').on('click', function () {
            layer.close(parentIndex);
            return false;
        });
        
        function bindshowPeopleImgClick() {
            $('#showReportImg').on('click', function () {
                var idBar = '#showReportImg';
                var src = $(idBar)[0].src;
                //debugger;
                var width = $(idBar).width();
                var height = $(idBar).height();
                var scaleWH = width / height;
                var bigH = 800;
                var bigW = scaleWH * bigH;
                if (bigW > 1000) {
                    bigW = 1000;
                    bigH = bigW / scaleWH;
                } // 放大预览图片
                parent.layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 1,
                    shadeClose: true,
                    area: [bigW + 'px', bigH + 'px'], //宽高
                    content: '<img width="' + bigW + '" src="' + src + '" />'
                });
            });
        }
    });

</script>